#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>
int removeElement(int* nums, int numsSize, int val) {
    int src = 0;
    int dst = 0;
    while (src < numsSize)
    {
        if (nums[src] != val)
        {
            nums[dst++] = nums[src++];
        }
        else
        {
            src++;
        }
    }
    return dst;
}
int main()
{
    int arr[10] = { 0,1,2,2,3,0,4,2 };
    int ret = 0;
    ret = removeElement(&arr, 4, 2);
    printf("%d\n", ret);
	return 0;
}